package com.sanyu.controller.admin;

import com.sanyu.pojo.dto.DistrictDTO;
import com.sanyu.pojo.dto.DistrictPageQueryDTO;
import com.sanyu.pojo.vo.DistrictVO;
import com.sanyu.result.PageResult;
import com.sanyu.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/district")
@Api("后台管理页面/片区管理相关接口")
public class DistrictController {

    @GetMapping("/page")
    @ApiOperation("片区的分页查询")
    public PageResult page(DistrictPageQueryDTO districtPageQueryDTO){
        return new PageResult();
    }

    @GetMapping("/{id}")
    @ApiOperation("列出指定ID片区的详细信息")
    public Result<DistrictVO> detail(@PathVariable Long id){
        return Result.success(new DistrictVO());
    }

    @PostMapping("/add")
    @ApiOperation("新增片区")
    public Result add(@RequestBody DistrictDTO districtDTO){
        return Result.success();
    }

    @DeleteMapping("/{id}")
    @ApiOperation("删除指定ID的片区")
    public Result delete(@PathVariable Long id){
        return Result.success();
    }

    @PutMapping
    @ApiOperation("修改指定ID的片区")
    public Result update(@RequestBody DistrictDTO districtDTO){
        return Result.success();
    }

}
